package javase2.day04.demo01;

import java.util.LinkedHashMap;
import java.util.Set;

/*
java.util.LinkedHashMap<k,v> extends HashMap<k,v>
用来存储有序的HashMap集合
底层原理：
        哈希表+链表
 */
public class Demo05LinkedHashMap {
    public static void main(String[] args) {
        LinkedHashMap<String,String> linked=new LinkedHashMap<>();
        linked.put("2","2");
        linked.put("0","0");
        linked.put("3","3");
        linked.put("1","1");
        linked.put("3","999");
        Set<String> linkedSet = linked.keySet();
        for (String str:linkedSet) {
            System.out.println(str+"="+linked.get(str));//不容许重复，有序
        }
    }
}
